<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加资讯-问答</title>
<#include '/frame/version.html'> 
<#include '/frame/manage/include_css.html'> 
<#include '/frame/manage/include_js.html'> 
<#include '/frame/taglib.html'>
<script type="text/javascript" src="${basePath}/js/jquery.artDialog.js"></script>
<script type="text/javascript" src="${basePath}/js/layer/layer.m.js"></script>
<script type="text/javascript" src="${basePath}/js/upyun.js"></script>
<script type="text/javascript" src="${basePath}/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="${basePath}/js/layerconfig.js"></script>
<script type="text/javascript" src="${basePath}/js/frames/common_uploader.js"></script>
<script type="text/javascript" src="${basePath}/js/ue/ueditor.config.js"></script>
<script type="text/javascript" src="${basePath}/js/ue/ueditor.all.js"></script>
<#include '/frame/taglib.html'>
</head>
<body id="nv_member" class="pg_CURMODULE">
	<#assign current='menu_ques_type'>
	<div id="wp" class="wp">
		<#include "/include/header.html"/>
		<!--中间内容-->
		<div class="contentmanage">
			<div class="developer">
				<div class="tableContent">
					<#include "/include/left.html"/> <#include "/include/wxtop.html"/>
					<div class="content">
						<div class="cLineB">
							<h4 class="left">添加资讯-问答</h4>
							<div class="clr"></div>
						</div>
						<style>
						.msgWrap {
							width: 900px;
						}
						</style>

						<div class="msgWrap bgfc">	
							<form id="actionform" method="post" enctype="multipart/form-data" action="${basePath}/admin/ques/save" >
							<#assign articleO=article >
								<table width="100%" cellspacing="0" cellpadding="0" border="0"
									style=" margin:0;" class="userinfoArea">
									<tbody>
										<tr>
                                            <th valign="top"><span class="red">*</span>文章标题:</th>
                                            <td>
                                            <input type="input" style="width:200px" name="name" value="${articleO.name!}" id="name" class="px">
                                            </td>
                                        </tr>
										<tr>
                                            <th valign="top"><span class="red">*</span>发布时间:</th>
                                            <td>
                                            <input type="text" class="px" id="publish" value='<#if articleO.publish?exists>${articleO.publish?string("yyyy-MM-dd HH:mm:ss")}</#if>' onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true})" name="publish" />
                                            
                                            </td>
                                        </tr>
										 <tr>
                                            <th valign="top"><span class="red">*</span>正文信息:</th>
                                            <td id="td_right_component">
                                                <script id="content" name="content" type="text/plain">${articleO.content?default('')}</script>
                                            </td>
                                        </tr>
										<tr>
											<th></th>
											<td>
											<#if article?? && articleO.id??>
											 <input type="hidden" name="id" value="${articleO.id}">
											</#if>
												<input class="btnGreen" id="add_ajax" name="button" type="submit"value="保存"/>&#12288;
												<a class="btnGray vm" href="${basePath}/admin/ques/index">取消</a></td>
										</tr>
									</tbody>
								</table>
								    <input id="token" type="hidden" name="token" value="${token!}" />
								    
							</form>
						</div>

					</div>
					<div class="clr"></div>
				</div>
			</div>
		</div>
	</div>
	<#include "/include/footer.html"/>
<script type="text/javascript">
 	 function addAjax() {
		if (true) {//参数校验错误信息
			jQuery.ajax({
				url : "",
				type : 'POST',
				data : $("#actionform").submit(),
				error : function(msg) {
					alert("系统繁忙,请稍后");
				},
				success : function(msg) {
					
						location.href = '${basePath}/admin/ques/index';
					
				}
			});
		} else {
		}
	}  
</script>
<!-- 实例化编辑器 -->
    <script type="text/javascript">
      var ue = UE.getEditor('content',{
	 autoHeightEnabled : false,
	 initialFrameWidth : 700,
	 initialFrameHeight : 500,
	 allowDivTransToP: false,
	 toolbars: [[
       'source', //源代码
       'fontfamily', //字体
       'fontsize', //字号
       'forecolor', //字体颜色
       'bold', //加粗
       'italic', //斜体
       'underline', //下划线
       'strikethrough', //删除线
       'subscript', //下标
       'fontborder', //字符边框
       'superscript', //上标
       'indent', //首行缩进
       'pasteplain', //纯文本粘贴模式
       'selectall', //全选
       'preview', //预览
       'horizontal', //分隔线
       'removeformat', //清除格式
       'time', //时间
       'date', //日期
       'unlink', //取消链接
       'inserttable', //插入表格
       'inserttitle', //插入标题
       'deletetable', //删除表格
       'cleardoc', //清空文档
       'paragraph', //段落格式
       'simpleupload', //单图上传
       'insertimage', //多图上传
       'link', //超链接
       'emotion', //表情
       'spechars', //特殊字符
       'map', //Baidu地图
       'insertvideo', //视频
       'justifyleft', //居左对齐
       'justifyright', //居右对齐
       'justifycenter', //居中对齐
       'justifyjustify', //两端对齐
       'backcolor', //背景色
       'fullscreen', //全屏
       'imagenone', //默认
       'imageleft', //左浮动
       'imageright', //右浮动
       'imagecenter', //居中
       'lineheight', //行间距
       'attachment', //附件
       'edittip ', //编辑提示
       'autotypeset', //自动排版
       'touppercase', //字母大写
       'tolowercase', //字母小写
       'background', //背景
       'template', //模板
       'scrawl', //涂鸦
       'music', //音乐
       'charts', // 图表
	]]
});
ue.addListener( 'ready', function( editor ) {
    layer.tips("<a href='javascript:void(0);' class='a_upload' onclick='openEditor();'>点我可以打开素材</a>","#edui1_toolbarbox",{tips: [2, '#44b549'],time:0});
});
    function openEditor(){
    	var left = 460;//$("#td_right_component").offset().left;
    	var height = ($(window).height()-10);
    	layer.open({
		    type: 2,
		    area: [left+'px', height+'px'],
		    fix: true,
		    shade:false,
		    offset: ['10px', '0px'],
		    title: false,
		    content: '${basePath}/anno/leditor'
		});
    }
    function insertIntoUe(content){
    	ue.setContent(content,true);
    }
    </script>
</body>
</html>